
import 'package:date_format/date_format.dart';
import 'package:flutter/cupertino.dart';
import 'package:get_storage/get_storage.dart';

class TimeUtil{
  static String parseTimeMileToDayTime(int timeile){
    String value="";
    value=formatDate(DateTime.fromMillisecondsSinceEpoch(timeile),
        [yyyy, '-', mm, '-', dd," ",HH, ':', nn, ':', ss]);

    return value;
  }

  static String parseTimeMileToDay(int timeile){
    String value="";
    value=formatDate(DateTime.fromMillisecondsSinceEpoch(timeile),
        [yyyy, '-', mm, '-', dd]);
    return value;
  }

  static String parseTimeMileToHour(int timeile){
    String value="";
    value=formatDate(DateTime.fromMillisecondsSinceEpoch(timeile),
        [HH, ':', nn, ':', ss]);
    return value;
  }


  static String parseCurrentTimeToyyyymmddhhmm(){
    String value="";
    int timeile=getTimeMile();
    value=formatDate(DateTime.fromMillisecondsSinceEpoch(timeile),
        [yyyy, '', mm, '', dd,"",HH, '', nn]);

    return value;
  }

  static String parseTimeToyyyymmdd(date){
    String value="";
    int timeile=date.millisecondsSinceEpoch;
    value=formatDate(DateTime.fromMillisecondsSinceEpoch(timeile),
        [yyyy, '-', mm, '-', dd]);

    return value;
  }

  static int getTimeMile(){
    DateTime nowDate = DateTime.now();
    return nowDate.millisecondsSinceEpoch;
  }
}